package com.ahwei.user.service.impl;

import com.ahwei.order.api.dto.OrderDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 订阅消息的服务，在接收消息后发送短信的服务！
 * </p>
 *
 * @author ahWei
 * @email：ahwei163@qq.com
 * @since 2022-05-31 15:00:01
 */
@Slf4j
@Service
@RocketMQMessageListener(consumerGroup = "shop-user-group", topic = "order-topic")
public class SmsService  implements RocketMQListener<OrderDto> {


    /**
     * 实现消费逻辑
     *
     * @param orderDto ·
     */
    @Override
    public void onMessage(OrderDto orderDto) {
        log.info("\n==> 收到一个订单信息{},接下来发送短信", orderDto);
    }
}
